home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_08_06 / 8n06098a < prev    next >
Text File  |  1990-03-21  |  370b  |  20 lines

  1.  
  2. /*
  3.  * Function:        alloc_rec
  4.  * Purpose:            Allocate memory for a Database record,
  5.  *                         checking for an allocation error
  6.  * Parameters:        None
  7.  * Return Value:    Pointer to memory, or NULL on error
  8.  */
  9.  
  10. struct record *alloc_rec(void)
  11. {
  12.     struct record *temp;
  13.     
  14.     if ((temp = malloc(sizeof(struct record))) == NULL)
  15.         return NULL;
  16.     else
  17.         return temp;
  18. }
  19.  
  20.